package com.gitee.hermer.engine.jars.core.event;

import org.springframework.context.ApplicationEvent;

import com.gitee.hermer.boot.jee.commons.collection.StringCache;

public abstract class EngineHandleEvent extends ApplicationEvent{
	
	protected String id;

	public EngineHandleEvent(String id,Object source) {
		super(source);
		setID(id);
	}
	
	public EngineHandleEvent(String id) {
		super("");
		setID(id);
	}
	
	private void setID(String id){
		this.id =new StringCache(id).append("-").append(getClass().getName()).toString();
	}
	
	public String getID(){
		return id;
	}
	
	@Override
	public String toString() {
		return getClass().getSimpleName() + "[source=" + source + "]";
	}
	
	

}
